package com.lch.designpattern.proxy.staticproxy;

import com.lch.designpattern.proxy.Person;

/**
 * @author: liuchenhui
 * @create: 2019-04-17 23:44
 **/
public class Father implements Person {
    private Son son;

    public Father(Son son) {
        this.son = son;
    }

    @Override
    public String getName() {
        return "father";
    }

    @Override
    public void findLove() {
        System.out.println("父亲帮忙找对象");
        son.findLove();
        System.out.println("双方父母见面");
    }

    @Override
    public void marryTo(Person person) {
        throw new RuntimeException("父亲为代理对象，不能结婚");
    }
}
